using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Features
{
    /// <summary>
    /// <para>Subdivide Polygon</para>
    /// <para>Divides polygon features into a number of equal areas or parts.</para>
    /// <para>将面要素划分为多个相等的区域或部分。</para>
    /// </summary>    
    [DisplayName("Subdivide Polygon")]
    public class SubdividePolygon : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SubdividePolygon()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_polygons">
        /// <para>Input Features</para>
        /// <para>The polygon features to be subdivided.</para>
        /// <para>要细分的面要素。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The output feature class of subdivided polygons.</para>
        /// <para>细分面的输出要素类。</para>
        /// </param>
        /// <param name="_method">
        /// <para>Subdivision Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the method that will be used to divide the polygons.</para>
        ///   <bulletList>
        ///     <bullet_item>Number of equal parts— Polygons will be divided evenly into a number of parts. This is the default.</bullet_item><para/>
        ///     <bullet_item>Equal areas—Polygons will be divided into a specified number of parts of a certain area, and a remainder part.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于划分多边形的方法。</para>
        ///   <bulletList>
        ///     <bullet_item>相等部分数 - 多边形将平均划分为多个部分。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>相等面积 - 面将被划分为特定区域的指定数量的部分和剩余部分。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        public SubdividePolygon(object _in_polygons, object _out_feature_class, _method_value _method)
        {
            this._in_polygons = _in_polygons;
            this._out_feature_class = _out_feature_class;
            this._method = _method;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Subdivide Polygon";

        public override string CallName => "management.SubdividePolygon";

        public override List<string> AcceptEnvironments => ["parallelProcessingFactor"];

        public override object[] ParameterInfo => [_in_polygons, _out_feature_class, _method.GetGPValue(), _num_areas, _target_area, _target_width, _split_angle, _subdivision_type.GetGPValue()];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The polygon features to be subdivided.</para>
        /// <para>要细分的面要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_polygons { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The output feature class of subdivided polygons.</para>
        /// <para>细分面的输出要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Subdivision Method</para>
        /// <para><xdoc>
        ///   <para>Specifies the method that will be used to divide the polygons.</para>
        ///   <bulletList>
        ///     <bullet_item>Number of equal parts— Polygons will be divided evenly into a number of parts. This is the default.</bullet_item><para/>
        ///     <bullet_item>Equal areas—Polygons will be divided into a specified number of parts of a certain area, and a remainder part.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于划分多边形的方法。</para>
        ///   <bulletList>
        ///     <bullet_item>相等部分数 - 多边形将平均划分为多个部分。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>相等面积 - 面将被划分为特定区域的指定数量的部分和剩余部分。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Subdivision Method")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _method_value _method { get; set; }

        public enum _method_value
        {
            /// <summary>
            /// <para>Number of equal parts</para>
            /// <para>Number of equal parts— Polygons will be divided evenly into a number of parts. This is the default.</para>
            /// <para>相等部分数 - 多边形将平均划分为多个部分。这是默认设置。</para>
            /// </summary>
            [Description("Number of equal parts")]
            [GPEnumValue("NUMBER_OF_EQUAL_PARTS")]
            _NUMBER_OF_EQUAL_PARTS,

            /// <summary>
            /// <para>Equal areas</para>
            /// <para>Equal areas—Polygons will be divided into a specified number of parts of a certain area, and a remainder part.</para>
            /// <para>相等面积 - 面将被划分为特定区域的指定数量的部分和剩余部分。</para>
            /// </summary>
            [Description("Equal areas")]
            [GPEnumValue("EQUAL_AREAS")]
            _EQUAL_AREAS,

        }

        /// <summary>
        /// <para>Number of Areas</para>
        /// <para>The number of areas into which the polygon will be divided if the Number of equal parts subdivision method is specified.</para>
        /// <para>如果指定了相等部分数细分方法，则多边形将划分为的区域数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of Areas")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _num_areas { get; set; } = null;


        /// <summary>
        /// <para>Target Area</para>
        /// <para>The area of the equal parts if the Equal areas subdivision method is specified. If the Target Area is larger than the area of the input polygon, the polygon will not be subdivided.</para>
        /// <para>如果指定了相等面积细分方法，则相等部分的面积。如果目标区域大于输入面的面积，则不会细分该面。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Target Area")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _target_area { get; set; } = null;


        /// <summary>
        /// <para>RESERVED</para>
        /// <para>This parameter is not yet supported.</para>
        /// <para>尚不支持此参数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("RESERVED")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _target_width { get; set; } = null;


        /// <summary>
        /// <para>Split Angle</para>
        /// <para>The angle that will be used to draw the lines that divide the polygon. The default is 0.</para>
        /// <para>将用于绘制分割多边形的线的角度。默认值为 0。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Split Angle")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double _split_angle { get; set; } = 0;


        /// <summary>
        /// <para>Subdivision Type</para>
        /// <para><xdoc>
        ///   <para>Specifies how the polygons will be divided.</para>
        ///   <bulletList>
        ///     <bullet_item>Strips— Polygons will be divided into strips. This is the default.</bullet_item><para/>
        ///     <bullet_item>Stacked blocks—Polygons will be divided into stacked blocks.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定多边形的划分方式。</para>
        ///   <bulletList>
        ///     <bullet_item>条带 - 多边形将被划分为条带。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>堆叠块—面将被划分为堆叠块。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Subdivision Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _subdivision_type_value _subdivision_type { get; set; } = _subdivision_type_value._STRIPS;

        public enum _subdivision_type_value
        {
            /// <summary>
            /// <para>Strips</para>
            /// <para>Strips— Polygons will be divided into strips. This is the default.</para>
            /// <para>条带 - 多边形将被划分为条带。这是默认设置。</para>
            /// </summary>
            [Description("Strips")]
            [GPEnumValue("STRIPS")]
            _STRIPS,

            /// <summary>
            /// <para>Stacked blocks</para>
            /// <para>Stacked blocks—Polygons will be divided into stacked blocks.</para>
            /// <para>堆叠块—面将被划分为堆叠块。</para>
            /// </summary>
            [Description("Stacked blocks")]
            [GPEnumValue("STACKED_BLOCKS")]
            _STACKED_BLOCKS,

        }

        public SubdividePolygon SetEnv(object parallelProcessingFactor = null)
        {
            base.SetEnv(parallelProcessingFactor: parallelProcessingFactor);
            return this;
        }

    }

}